package com.example.service.impl;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.domain.po.Farmer;
import com.example.service.FarmerService;
import com.example.mapper.FarmerMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
* @author adim
* @description 针对表【farmer(农户信息表，关联产区并标识是否为品牌农户)】的数据库操作Service实现
* @createDate 2025-06-15 01:04:46
*/
@Service
@RequiredArgsConstructor
public class FarmerServiceImpl extends ServiceImpl<FarmerMapper, Farmer>
    implements FarmerService{

    private final FarmerMapper farmerMapper;
    @Override
    public Farmer getByRegionId(Integer id) {
        return lambdaQuery().eq(id != null,Farmer::getProductionAreaId,id).one();
    }
}




